<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
	<div class="schedule">
    	<div class="box corner"></div><div class="box day">Sunday</div> <div class="box day">Monday</div> <div class="box day">Tuesday</div> <div class="box day">Wednesday</div> <div class="box day">Thursday</div> <div class="box day">Friday</div> <div class="box day">Saturday</div>
	 	<div class="box time">9:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[10 > number(@start)]/@title"/></div>
		</xsl:for-each>
		<div class="box time">10:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[10 >= number(@start) and number(@end) > 10]/@title"/></div>
		</xsl:for-each>
		<div class="box time">11:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[11 >= number(@start) and number(@end) > 11]/@title"/></div>
		</xsl:for-each>
		<div class="box time">12:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[12 >= number(@start) and number(@end) > 12]/@title"/></div>
		</xsl:for-each>
		<div class="box time">13:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[13 >= number(@start) and number(@end) > 13]/@title"/></div>
		</xsl:for-each>
		<div class="box time">14:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[14 >= number(@start) and number(@end) > 14]/@title"/></div>
		</xsl:for-each>
		<div class="box time">15:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[15 >= number(@start) and number(@end) > 15]/@title"/></div>
		</xsl:for-each>
		<div class="box time">16:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[16 > number(@start) and number(@end) > 16]/@title"/></div>
		</xsl:for-each>
		<div class="box time">17:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m"><xsl:value-of select="course[17 >= number(@start) and number(@end) > 17]/@title"/></div>
		</xsl:for-each>
		<div class="box time">18:00</div>
		<xsl:for-each select="timetable/day">
			<div id="m" class="box course-box m last"><xsl:value-of select="course[18 >= number(@start) and number(@end) > 18]/@title"/></div>
		</xsl:for-each>
	</div>

</xsl:template>
</xsl:stylesheet>

